//
//  GCMineHomeCollectionHeader.m
//  GoldChampion
//
//  Created by Mac on 2018/4/13.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "GCOtherHomeCollectionHeader.h"

@interface GCOtherHomeCollectionHeader()
@property(nonatomic, strong) STButton                     *iconButton;
@property(nonatomic, strong) STLabel                     *fansLable;
@property(nonatomic, strong) STLabel                     *attentionLable;

@property(nonatomic, strong) STButton                     *infoButton;
@property(nonatomic, strong) STLabel                     *desLaLable;
@property(nonatomic, strong) STButton                     *likeButton;


@end
@implementation GCOtherHomeCollectionHeader
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self configSubView];
    }
    return self;
}
#pragma mark --subView
- (void)configSubView{
    __weak typeof(self) weakSelf =  self;
    UIView * clearView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 135)];
    clearView.backgroundColor = [UIColor clearColor];
    
    UIView * whiteView = [[UIView alloc] initWithFrame:CGRectMake(0, clearView.bottom, UIScreenWidth, 170)];
    whiteView.backgroundColor = [UIColor whiteColor];
    [self addSubview:whiteView];
    
    self.iconButton = [[STButton alloc] initWithFrame:CGRectMake(15, clearView.bottom - 50, 100, 100)
                                                title:nil
                                           titleColor:nil
                                            titleFont:0
                                         cornerRadius:50
                                      backgroundColor:nil
                                      backgroundImage:[UIImage imageNamed:@"4"]
                                                image:nil];
    [self addSubview:self.iconButton];
    
    CGFloat itemwWith = (UIScreenWidth - 30 - self.iconButton.right)/3;
    
    self.fansLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right+15, 0, itemwWith, 44)
                                               text:@"108粉丝"
                                          textColor:SecendTextColor
                                               font:12
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    [whiteView addSubview:self.fansLable];
    [self.fansLable st_showRightLine:15];
    
    self.attentionLable = [[STLabel alloc] initWithFrame:CGRectMake(self.fansLable.right, 0, itemwWith, 44)
                                                    text:@"998关注"
                                               textColor:SecendTextColor
                                                    font:12
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentCenter];
    [whiteView addSubview:self.attentionLable];
    
    
    STButton * enditButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, itemwWith, 25)
                                                       title:@"同城关注"
                                                  titleColor:TM_redColor
                                                   titleFont:12
                                                cornerRadius:4
                                             backgroundColor:nil
                                             backgroundImage:nil
                                                       image:nil];
    enditButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    enditButton.right = UIScreenWidth - 15;
    enditButton.centerY = self.attentionLable.centerY;
    [enditButton setClicAction:^(UIButton *sender) {
        if (weakSelf.onSelectedMenuHandle) {
            weakSelf.onSelectedMenuHandle(@"同城关注");
        }
    }];
    [whiteView addSubview:enditButton];
    
    
    self.infoButton = [[STButton alloc] initWithFrame:CGRectMake(self.iconButton.left, self.iconButton.height/2 + 5, 250, 40)
                                                        title:@"处女座 王静 北京市"
                                                   titleColor:SecendTextColor
                                                    titleFont:15
                                                 cornerRadius:0
                                              backgroundColor:nil
                                              backgroundImage:nil
                                                        image:[UIImage imageNamed:@"男"]];
    self.infoButton.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
    [whiteView addSubview:self.infoButton];
    
    self.desLaLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.left, self.infoButton.bottom + 5, UIScreenWidth - 30, 44)
                                                text:@"人在北京喜欢旅游，唱k，交朋友，稀饭的亲加我微信:da12414124......."
                                               textColor:SecendTextColor
                                                    font:14
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentLeft];
    [NSString lableAutoAdjustheightWithLabel:self.desLaLable];
    [whiteView addSubview:self.desLaLable];
    
    
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 40)
                                                     text:@"作品集"
                                                textColor:SecendTextColor
                                                     font:14
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
    [self addSubview:titleLable];
    titleLable.bottom = self.height;
}

@end

